package com.lazybones.base.engineer.common.conf.flex;

import com.mybatisflex.core.FlexGlobalConfig;
import com.mybatisflex.core.mybatis.FlexConfiguration;
import com.mybatisflex.spring.boot.ConfigurationCustomizer;
import org.apache.ibatis.logging.stdout.StdOutImpl;
import org.springframework.context.annotation.Configuration;

@Configuration
public class MyConfigurationCustomizer implements ConfigurationCustomizer {
    @Override
    public void customize(FlexConfiguration flexConfiguration) {
        flexConfiguration.setLogImpl(StdOutImpl.class);
        FlexGlobalConfig flexGlobalConfig = FlexGlobalConfig.getDefaultConfig();
        //设置数据库正常时的值
        flexGlobalConfig.setNormalValueOfLogicDelete(0);
        //设置数据已被删除时的值
        flexGlobalConfig.setDeletedValueOfLogicDelete(1);
    }
}
